/*
 * CirculationViewPanel.java
 *
 * Created on 22.6.2011, 13:45:33
 */
package net.parostroj.timetable.gui.components;

import net.parostroj.timetable.gui.utils.ResourceLoader;
import net.parostroj.timetable.model.TrainDiagram;
import net.parostroj.timetable.model.TrainsCycle;

/**
 * Panel with circulation view and buttons.
 *
 * @author jub
 */
public class CirculationViewPanel extends javax.swing.JPanel {

    /** Creates new form CirculationViewPanel */
    public CirculationViewPanel() {
        initComponents();
    }
    
    public void setDiagram(TrainDiagram diagram) {
        circulationView.setDiagram(diagram);
    }
    
    public void circulationRemoved(TrainsCycle circulation) {
        circulationView.circulationRemoved(circulation);
    }
    
    public void circulationAdded(TrainsCycle circulation) {
        circulationView.circulationAdded(circulation);
    }
    
    public void circulationUpdated(TrainsCycle circulation) {
        circulationView.circulationUpdated(circulation);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        circulationView = new net.parostroj.timetable.gui.components.CirculationView();
        javax.swing.JPanel buttonPanel = new javax.swing.JPanel();
        javax.swing.JButton saveButton = new javax.swing.JButton();

        setLayout(new java.awt.BorderLayout());

        javax.swing.GroupLayout circulationViewLayout = new javax.swing.GroupLayout(circulationView);
        circulationView.setLayout(circulationViewLayout);
        circulationViewLayout.setHorizontalGroup(
            circulationViewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        circulationViewLayout.setVerticalGroup(
            circulationViewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 263, Short.MAX_VALUE)
        );

        add(circulationView, java.awt.BorderLayout.CENTER);

        buttonPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        buttonPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        saveButton.setText(ResourceLoader.getString("gt.save")); // NOI18N
        saveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveButtonActionPerformed(evt);
            }
        });
        buttonPanel.add(saveButton);

        add(buttonPanel, java.awt.BorderLayout.SOUTH);
    }// </editor-fold>//GEN-END:initComponents

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
    }//GEN-LAST:event_saveButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private net.parostroj.timetable.gui.components.CirculationView circulationView;
    // End of variables declaration//GEN-END:variables
}
